//Cristian Moral Martos

package Ejercicio02;

import java.io.IOException;

import utils.ImagePGM;

/**
 * Exercise 2.1 Implement the following function to compare two input images:
 * 
 * imAreEqual (imageIn1, imageIn2) // return true or false depending on whether
 * the two input images imageIn1 and imageIn2 are equal or not (the sizes of the
 * two images are supposed to be the same)
 * 
 * Note: two images are equal if and only if the intensity value of every pixel
 * (x,y) of imageIn1 is equal to the intensity value of the same pixel (x,y) of
 * imageIn2.
 * 
 */
public class Ejercicio21 {

	public static void main(String[] args) throws IOException {
		// Recuperamos los paths de las imagenes a comparar
		String path1 = "input\\cam_74.pgm";
		ImagePGM image1 = new ImagePGM(path1);

		String path2 = "input\\cam_74.pgm";
		ImagePGM image2 = new ImagePGM(path2);

		System.out.println("Las imagenes " + path1 + " y " + path2
				+ (image1.compare(image2) ? "" : " no") + " son iguales");

		// Comparamos otras dos imagenes
		String path3 = "input\\gran01_64.pgm";
		ImagePGM image3 = new ImagePGM(path3);

		System.out.println("Las imagenes " + path1 + " y " + path3
				+ (image1.compare(image3) ? "" : " no") + " son iguales");

	}
}
